<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateEventStatisticsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('event_statistics', function (Blueprint $table) {
//            $table->comment('跟activity_info关联');
            $table->bigInteger('id', true);
            $table->bigInteger('activity_info_id')->index('idx_activity_info_id')->comment('infoId');
            $table->bigInteger('data_version_id')->nullable()->comment('版本id');
            $table->string('type', 255)->nullable()->index('idx_type')->comment('事件类型');
            $table->string('child_type', 255)->nullable()->index('idx_child_type')->comment('事件子类');
            $table->string('name', 255)->nullable()->comment('事件名称');
            $table->string('level', 255)->nullable()->comment('级别');
            $table->string('grade', 255)->nullable()->comment('年级');
            $table->string('subject', 50)->nullable()->comment('学科');
            $table->string('compere', 255)->nullable()->comment('主持人');
            $table->string('participant', 1000)->nullable()->comment('参与人');
            $table->date('date')->nullable()->comment('事件时间');
            $table->date('begin_date')->nullable()->comment('开始时间');
            $table->date('end_date')->nullable()->comment('结束时间');
            $table->tinyInteger('deleted')->nullable()->default(0);
            $table->timestamp('created_at')->nullable()->useCurrent();
            $table->timestamp('updated_at')->useCurrentOnUpdate()->nullable()->useCurrent();
            $table->bigInteger('creator_id')->nullable();
            $table->bigInteger('updater_id')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('event_statistics');
    }
};
